<template>
  <header class="header">
    <div class="header-container">
      <!-- Logo -->
      <div class="logo">
        <img src="/src/assets/xiaohongshu.png" alt="小红书" class="logo-image" />
      </div>
      
      <!-- 搜索框 -->
      <div class="search-container">
        <div class="search-box">
                <img src="/src/assets/icons/search.png" alt="搜索" class="search-icon" />
          <input 
            type="text" 
            placeholder="搜索小红书" 
            class="search-input"
            v-model="searchQuery"
          />
        </div>
      </div>
      
      <!-- 右侧操作区 -->
      <div class="header-actions">
        <button class="action-btn">创作中心</button>
        <button class="action-btn">业务合作</button>
        <div class="user-avatar">
          <img src="https://ts1.tc.mm.bing.net/th/id/R-C.cbcc58d28a3938d1c825b9cb6bdac212?rik=7PpzBlY2Z4mALA&riu=http%3a%2f%2fwww.itedou.com%2fUploads%2fstar%2f20190521%2f175601.jpg&ehk=rSwcnDKCDFOsKgf6MvBfj%2fU3dN7C2qXtKvGfENDdsWw%3d&risl=&pid=ImgRaw&r=0" alt="用户头像" />
        </div>
      </div>
    </div>
  </header>
</template>

<script setup>
import { ref } from 'vue'

const searchQuery = ref('')
</script>

<style scoped>
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  border-bottom: 1px solid #e8e8e8;
  z-index: 1000;
  height: 60px;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.logo-image {
  height: 35px;
  width: auto;
  object-fit: contain;
  transition: all 0.3s ease;
  cursor: pointer;
}

.logo-image:hover {
  transform: scale(1.05);
}

.search-container {
  flex: 1;
  max-width: 400px;
  margin: 0 60px 0 40px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: #f0f0f0;
  border-radius: 20px;
  padding: 8px 16px;
}

.search-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  margin-right: 8px;
}

.search-input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 14px;
  color: #333;
}

.search-input::placeholder {
  color: #999;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.action-btn {
  background: none;
  border: none;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.action-btn:hover {
  background: #f5f5f5;
}

.user-avatar img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
</style>
